package cn.edu.nchu.fragmentdemo.db.dao;

import android.content.Context;

import com.j256.ormlite.dao.Dao;

import cn.edu.nchu.fragmentdemo.bean.MarkerSet;
import cn.edu.nchu.fragmentdemo.db.helper.ORMLiteHelper;

import java.sql.SQLException;

public class MarkerSetDao {

    private static Dao<MarkerSet, Integer> markerSet;

    public static Dao<MarkerSet, Integer> getmarkerSetDao(Context context) {
        if (markerSet == null) {
            synchronized (MarkerSetDao.class) {
                if (markerSet == null) {
                    try {
                        markerSet = (Dao) ORMLiteHelper.getInstance(context).getDao(MarkerSet.class);
                    } catch (SQLException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                }
            }
        }
        return markerSet;
    }
}
